class DidaticMaterialsController < ApplicationController
  # GET /didatic_materials
  # GET /didatic_materials.xml
  def index
    @didatic_materials = DidaticMaterial.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @didatic_materials }
    end
  end

  # GET /didatic_materials/1
  # GET /didatic_materials/1.xml
  def show
    @didatic_material = DidaticMaterial.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @didatic_material }
    end
  end

  # GET /didatic_materials/new
  # GET /didatic_materials/new.xml
  def new
    @didatic_material = DidaticMaterial.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @didatic_material }
    end
  end

  # GET /didatic_materials/1/edit
  def edit
    @didatic_material = DidaticMaterial.find(params[:id])
  end

  # POST /didatic_materials
  # POST /didatic_materials.xml
  def create
    @didatic_material = DidaticMaterial.new(params[:didatic_material])

    respond_to do |format|
      if @didatic_material.save
        format.html { redirect_to(@didatic_material, :notice => 'Didatic material was successfully created.') }
        format.xml  { render :xml => @didatic_material, :status => :created, :location => @didatic_material }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @didatic_material.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /didatic_materials/1
  # PUT /didatic_materials/1.xml
  def update
    @didatic_material = DidaticMaterial.find(params[:id])

    respond_to do |format|
      if @didatic_material.update_attributes(params[:didatic_material])
        format.html { redirect_to(@didatic_material, :notice => 'Didatic material was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @didatic_material.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /didatic_materials/1
  # DELETE /didatic_materials/1.xml
  def destroy
    @didatic_material = DidaticMaterial.find(params[:id])
    @didatic_material.destroy

    respond_to do |format|
      format.html { redirect_to(didatic_materials_url) }
      format.xml  { head :ok }
    end
  end
end
